package day06;

import com.sun.org.apache.xml.internal.dtm.DTMAxisTraverser;
import day05.MaxOfArray;

import java.util.Arrays;

public class Exercise06 {
    public static void main(String[] args) {
        int [] a={1,6,999,99,500,60};
        int max=getMaxOfArray(a);
        System.out.println(max);
        printArrayData(a);
    }
    public static int getMaxOfArray(int[] a){
       int Max =0;
//        for (int i=0;i<a.length;i++){
//            if (a[i]>Max)
//                Max=a[i];
//        }
        Arrays.sort(a);
        Max=a[a.length-1];
        return Max;
    }
    public static  void printArrayData(int [] a){
        for (int x:a)
            System.out.print(x+",");
    }
}
